From 8fc3724a4ac144e113beb70f18f25f2c2d56a610 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 4 Dec 2008 15:59:26 +0000 Subject: [PATCH] API: (bug 16541) Adding block expiry timestamp to list=logevents output (calculated from the block's timestamp and its duration) --- RELEASE-NOTES | 1 + includes/api/ApiQueryLogEvents.php | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2804408f4b..29e06410df 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -483,6 +483,7 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 16526) Added usprop=emailable to list=users * (bug 16548) list=search threw errors with an invalid error code * (bug 16515) Added pst and onlypst parameters to action=parse +* (bug 16541) Added block expiry timestamp to list=logevents output === Languages updated in 1.14 === diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 84bd15d6ec..beb2963e86 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -140,7 +140,7 @@ class ApiQueryLogEvents extends ApiQueryBase { $this->getResult()->addValue('query', $this->getModuleName(), $data); } - public static function addLogParams($result, &$vals, $params, $type) { + public static function addLogParams($result, &$vals, $params, $type, $ts) { $params = explode("\n", $params); switch ($type) { case 'move': @@ -169,6 +169,8 @@ class ApiQueryLogEvents extends ApiQueryBase { case 'block': $vals2 = array(); list( $vals2['duration'], $vals2['flags'] ) = $params; + $vals2['expiry'] = wfTimestamp(TS_ISO_8601, + strtotime($params[0], wfTimestamp(TS_UNIX, $ts))); $vals[$type] = $vals2; $params = null; break; @@ -200,7 +202,8 @@ class ApiQueryLogEvents extends ApiQueryBase { if ($this->fld_details && $row->log_params !== '') { self::addLogParams($this->getResult(), $vals, - $row->log_params, $row->log_type); + $row->log_params, $row->log_type, + $row->log_timestamp); } if ($this->fld_user) { -- 2.20.1